/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 收藏加入 POST /api/article/addCollect */
export async function addCollectUsingPost({
  body,
  options,
}: {
  body: API.wenzhangshoucangcanshu;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/article/addCollect', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 收藏取消 POST /api/article/cancelCollect */
export async function cancelCollectUsingPost({
  body,
  options,
}: {
  body: API.wenzhangshoucangcanshu;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/article/cancelCollect', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 文章分类 GET /api/article/cate */
export async function categoryUsingGet({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultListwenzhangfenleiVo>('/api/article/cate', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 收藏列表 GET /api/article/collect */
export async function collectUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.collectUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultPageResultwenzhangshoucangVo>(
    '/api/article/collect',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 文章详情 GET /api/article/detail */
export async function detailUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.detailUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultwenzhangxiangqingVo>('/api/article/detail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 文章列表 GET /api/article/lists */
export async function listsUsingGet1({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.listsUsingGET1Params;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultPageResultwenzhangliebiaoVo>(
    '/api/article/lists',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
